1. Field of the Invention
The present invention relates to a technique to calibrate orientation measured in a portable terminal apparatus including a magnetic sensor to detect the orientation and a tilt sensor to detect a tilt, by periodically capturing magnetic data and calculating an offset due to a magnetic field, and particularly to a technique to suitably control a capture time interval of the magnetic data correspondingly to movement of the portable terminal apparatus.
2. Description of the Related Art
In recent years, a portable terminal apparatus such as a cellular phone has been advanced in function, and one including a magnetic sensor to detect the earth magnetism (geomagnetism) in order to measure azimuth orientation and a tilt sensor to detect the tilt of a device casing has been developed. Besides, in portable terminal apparatuses including magnetic sensors, there is one provided with an auto-calibration function to correct an error (offset) due to internal magnetic field generated by an electronic part in the inside of the portable terminal apparatus.
In a conventional auto-calibration function, magnetic data is periodically captured and is stored, and a specified calibration process is performed. As the calibration process, for example, a method is adopted in which the magnetic data is collected over a certain range of orientation through which the portable terminal apparatus is turned, and then, an azimuth sphere is calculated from the collected data, and the offset is set in terms of deviation of the sphere center from an origin and updated because the offset varies along the passage of time.
As this kind of related art, there is also one disclosed in patent document 1. This document discloses a technique in which a measurement rod having a magnetic sensor is arbitrarily rotated, and a detected position coordinate is compared with a position coordinate separately obtained by calculation, so that an error correspondence table is set and updated.
[Patent Document] JP-A-2004-101273
In the foregoing related art, there has been a problem that due to the variety of usage pattern of the portable terminal apparatus, it is difficult to suitably set a sampling time of magnetic data.
That is, in a normal use environment of the portable terminal apparatus, the tilt of the device casing and the orientation are not necessarily changed frequently. In the case where the tilt or the orientation is not changed very much, there occurs a noticeable harmful effect that meaningless data without variation in orientation is stored even if the sampling time is shortened. On the other hand, like a case where the user intentionally swings the device casing in order to cause calibration to be performed, there is also a conceivable case where the tilt and orientation are significantly changed in a short time. In this case, when the sampling time is short, the accumulation of magnetic data necessary for the calibration can be completed in a short time, however, when the sampling time is long, it takes time to collect and store magnetic data, and there occurs a disadvantage that the user is urged to perform the swing operation for a long time. Patent document 1 does not disclose a technique to solve such problems.